<!DOCTYPE html>
<html lang="">

<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>国内旅客信息-机票预订-南方航空csair.com</title>
    <script src="asserts/js/jquery-3.6.0.js"></script>
    <script src="asserts/bootstrap-3.4.1-dist/js/bootstrap.min.js"></script>
    <link rel="stylesheet" type="text/css" href="asserts/bootstrap-3.4.1-dist/css/bootstrap.min.css"/>
    <link rel="stylesheet" type="text/css" href="asserts/bootstrap-3.4.1-dist/css/bootstrap-theme.css"/>
    <link rel="stylesheet" type="text/css" href="asserts/css/cloud.css"/>

    <style>

        /* From www.lingdaima.com */
        .button {
            display: inline-block;
            border-radius: 7px;
            border: none;
            background: #1875FF;
            color: white;
            font-family: inherit;
            text-align: center;
            font-size: 13px;
            box-shadow: 0px 14px 56px -11px #1875FF;
            width: 10em;
            padding: 1em;
            transition: all 0.4s;
            cursor: pointer;
        }

        .button span {
            cursor: pointer;
            display: inline-block;
            position: relative;
            transition: 0.4s;
        }

        .button span:after {
            content: 'for free';
            position: absolute;
            opacity: 0;
            top: 0;
            right: -20px;
            transition: 0.7s;
        }

        .button:hover span {
            padding-right: 3.55em;
        }

        .button:hover span:after {
            opacity: 4;
            right: 0;
        }

        .zfb {

            border: 2px solid #adadad59;
            width: 250px;
            height: 60px;
            line-height: 56px;
            text-align: center;
            border-radius: 5px;
            margin: 20px;
        }

        .zfb:hover {
            background: rgba(255, 255, 255, 0.38);
        }

        .navbar-default {
            background-color: #ffffffcf;;
            border-color: #e7e7e7;
        }

        .navbar-default {
            background-image: -webkit-linear-gradient(top, rgba(255, 255, 255, 0.45), rgba(255, 255, 255, 0.45) 100%);
            background-image: -o-linear-gradient(top, rgba(255, 255, 255, 0.45), rgba(255, 255, 255, 0.45) 100%);
            background-image: -webkit-gradient(linear, left top, left bottom, from(rgba(255, 255, 255, 0.45)), to(rgba(255, 255, 255, 0.45)));
            background-image: linear-gradient(to bottom, rgba(255, 255, 255, 0.45), rgba(255, 255, 255, 0.45) 100%);
            filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#ffffff', GradientType=0);
            background-repeat: repeat-x;
            filter: progid:DXImageTransform.Microsoft.gradient(enabled=false);
            border-radius: 0px;
            -webkit-box-shadow: inset 0 1px 0 rgb(255 255 255 / 15%), 0 1px 5px rgb(0 0 0 / 8%);
            box-shadow: inset 0 1px 0 rgb(255 255 255 / 15%), 0 1px 5px rgb(0 0 0 / 8%);
        }

        .card1 {
            background-color: rgba(255, 255, 255, 0.55);
            backdrop-filter: blur(13px);
            -webkit-backdrop-filter: blur(13px);
            border: 1px solid rgba(255, 255, 255, 0.18);
            box-shadow: rgba(142, 142, 142, 0.19) 0px 6px 15px 0px;
            -webkit-box-shadow: rgba(142, 142, 142, 0.19) 0px 6px 15px 0px;
            border-radius: 7px;
            -webkit-border-radius: 7px;
            color: rgb(255, 255, 255);
            width: 900px;
            margin: 0 auto;
        }

        #wai {
            text-align: center;
        }

        #card2 {
            background-color: rgba(245, 245, 245, 0.58);
            /* backdrop-filter: blur(13px); */
            -webkit-backdrop-filter: blur(13px);
            /* border: 1px solid rgba(255, 255, 255, 0.18); */
            /* box-shadow: rgb(142 142 142 / 19%) 0px 6px 15px 0px; */
            /* -webkit-box-shadow: rgb(142 142 142 / 19%) 0px 6px 15px 0px; */
            border-radius: 5px;
            /* -webkit-border-radius: 7px; */
            /* color: rgb(255, 255, 255); */
            margin: 20px;
            height: 110px;
            text-align: left;
        }

        .trs {
            border-radius: 7px;
            margin-top: 10px;
            background: rgba(255, 255, 255, 0.8);
            padding-bottom: 10px;
            padding-top: 10px;
            height: 90px;
            margin-left: -10px;
            margin-right: -10px;
        }

        .md {
            padding-left: 0px;
            padding-right: 0px;
        }

        .cnm {
            padding-left: 20px;
            padding-right: 0px;
        }

        .rr {
            text-align: right;
        }

        .zls-flg-dir {
            border-bottom: 2px solid #bcc9d7;
            height: 4px;
            position: relative;
            margin-top: 0px;
        }

        .zls-flg-dir i {
            position: absolute;
            right: -3px;
            top: -2px;
            width: 0;
            height: 0;
            border-left: 12px solid #bcc9d7;
            border-top: 6px solid transparent;
        }

        .ll {
            padding-left: 25px;
        }

        .zz {
            text-align: center;
        }

        .jian {
            padding: 0 10px;
        }

        .time {
            margin-top: 24px;
            margin-bottom: 0px;
        }

        .fr {
            font-size: 16px;
            margin-bottom: 0px;
            margin-top: 12px;
        }

        .dd {
            font-size: 25px;
            margin-top: 5px;
        }

        .kk {
            font-size: 16px;
            margin-bottom: 0px;
            margin-top: 19px;
        }

        .zhl {
            font-size: 10px;
        }
    </style>
</head>

<body>


<div>
    <div class="frame">
        <div class="plane-container">
            <svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px"
                 y="0px"
                 width="1131.53px" height="379.304px" viewBox="0 0 1131.53 379.304"
                 enable-background="new 0 0 1131.53 379.304"
                 xml:space="preserve" class="plane">
                    <polygon fill="#D8D8D8"
                             points="72.008,0 274.113,140.173 274.113,301.804 390.796,221.102 601.682,367.302 1131.53,0.223  "/>
                <polygon fill="#C4C4C3" points="1131.53,0.223 274.113,140.173 274.113,301.804 390.796,221.102   "/>
            </svg>

        </div>
    </div>
    <div class="clouds">

        <svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
             width="762px"
             height="331px" viewBox="0 0 762 331" enable-background="new 0 0 762 331" xml:space="preserve"
             class="cloud big front slowest">
            <path fill="#FFFFFF" d="M715.394,228h-16.595c0.79-5.219,1.201-10.562,1.201-16c0-58.542-47.458-106-106-106
            c-8.198,0-16.178,0.932-23.841,2.693C548.279,45.434,488.199,0,417.5,0c-84.827,0-154.374,65.401-160.98,148.529
            C245.15,143.684,232.639,141,219.5,141c-49.667,0-90.381,38.315-94.204,87H46.607C20.866,228,0,251.058,0,279.5
            S20.866,331,46.607,331h668.787C741.133,331,762,307.942,762,279.5S741.133,228,715.394,228z"/>
        </svg>
        <svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
             width="762px"
             height="331px" viewBox="0 0 762 331" enable-background="new 0 0 762 331" xml:space="preserve"
             class="cloud distant smaller">
            <path fill="#FFFFFF" d="M715.394,228h-16.595c0.79-5.219,1.201-10.562,1.201-16c0-58.542-47.458-106-106-106
            c-8.198,0-16.178,0.932-23.841,2.693C548.279,45.434,488.199,0,417.5,0c-84.827,0-154.374,65.401-160.98,148.529
            C245.15,143.684,232.639,141,219.5,141c-49.667,0-90.381,38.315-94.204,87H46.607C20.866,228,0,251.058,0,279.5
            S20.866,331,46.607,331h668.787C741.133,331,762,307.942,762,279.5S741.133,228,715.394,228z"/>
        </svg>

        <svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
             width="762px"
             height="331px" viewBox="0 0 762 331" enable-background="new 0 0 762 331" xml:space="preserve"
             class="cloud small slow">
            <path fill="#FFFFFF" d="M715.394,228h-16.595c0.79-5.219,1.201-10.562,1.201-16c0-58.542-47.458-106-106-106
            c-8.198,0-16.178,0.932-23.841,2.693C548.279,45.434,488.199,0,417.5,0c-84.827,0-154.374,65.401-160.98,148.529
            C245.15,143.684,232.639,141,219.5,141c-49.667,0-90.381,38.315-94.204,87H46.607C20.866,228,0,251.058,0,279.5
            S20.866,331,46.607,331h668.787C741.133,331,762,307.942,762,279.5S741.133,228,715.394,228z"/>
        </svg>

        <svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
             width="762px"
             height="331px" viewBox="0 0 762 331" enable-background="new 0 0 762 331" xml:space="preserve"
             class="cloud distant super-slow massive">
            <path fill="#FFFFFF" d="M715.394,228h-16.595c0.79-5.219,1.201-10.562,1.201-16c0-58.542-47.458-106-106-106
            c-8.198,0-16.178,0.932-23.841,2.693C548.279,45.434,488.199,0,417.5,0c-84.827,0-154.374,65.401-160.98,148.529
            C245.15,143.684,232.639,141,219.5,141c-49.667,0-90.381,38.315-94.204,87H46.607C20.866,228,0,251.058,0,279.5
            S20.866,331,46.607,331h668.787C741.133,331,762,307.942,762,279.5S741.133,228,715.394,228z"/>
        </svg>

        <svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
             width="762px"
             height="331px" viewBox="0 0 762 331" enable-background="new 0 0 762 331" xml:space="preserve"
             class="cloud slower">
            <path fill="#FFFFFF" d="M715.394,228h-16.595c0.79-5.219,1.201-10.562,1.201-16c0-58.542-47.458-106-106-106
            c-8.198,0-16.178,0.932-23.841,2.693C548.279,45.434,488.199,0,417.5,0c-84.827,0-154.374,65.401-160.98,148.529
            C245.15,143.684,232.639,141,219.5,141c-49.667,0-90.381,38.315-94.204,87H46.607C20.866,228,0,251.058,0,279.5
            S20.866,331,46.607,331h668.787C741.133,331,762,307.942,762,279.5S741.133,228,715.394,228z"/>
        </svg>

    </div>

</div>

<!--导航栏-->
<nav class="navbar navbar-default">
    <div class="container-fluid">
        <!-- Brand and toggle get grouped for better mobile display -->
        <div class="navbar-header">
            <button type="button" class="navbar-toggle collapsed" data-toggle="collapse"
                    data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
                <span class="sr-only">Toggle navigation</span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>
            <img style="margin-left: 30px;height: 30px;width: auto;margin-top: 10px;" src="asserts/img/logo.png"/>
        </div>

        <!-- Collect the nav links, forms, and other content for toggling -->
        <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
            <ul class="nav navbar-nav">
                <li class="active"><a
                        style="margin-left: 40px;box-shadow: 0 3px 9px rgb(0 0 0 / 8%);    background-image: linear-gradient(to bottom, #ffffff 0%, #ffffff 100%);"
                        href="#">购票<span class="sr-only">(current)</span></a></li>
                <li><a href="return.html">购票记录</a></li>

            </ul>
            <ul class="nav navbar-nav navbar-right">
                <li><a id="weather" href="#">天气</a></li>
                <li class="dropdown">
                    <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true"
                       aria-expanded="false" id="namee">{用户名}<span class="caret"></span></a>
                    <ul class="dropdown-menu">
                        <li><a href="#">个人信息</a></li>
                        <li><a href="#">退出登录</a></li>
                    </ul>
                </li>
            </ul>
        </div>
    </div>
</nav>


<div id="wai" style="
display: flex;
display: -webkit-flex;
/* 从左端开始沿水平轴防止flex item */
flex-direction: row;
/* 强制 flex item不换行，沿着同一行堆叠 */
flex-wrap: nowrap;
/* flex item在主轴上的对齐方式，这里定义左对齐 */
justify-content: flex-start;
/* 定义交叉轴对其方式 */
align-items: flex-start">

    <div id="card1" class="card1" style="width: 300px;margin-right: 0px;">


        <div class="row" style="color: #000;margin-top: 15px;">
            <div class="col-md-5 md " style="margin-left: 10px">
                <b id="rqft" style="font-size: 25px;margin-top: 5px;">00:00</b>
                <p id="rqfj">未选择</p>
            </div>
            <div class="col-md-1 md zz">
                <p style="margin-top: 20px"><font face="verdana">-></font></p>
            </div>
            <div class="col-md-5 md" style="margin-right: -10px">
                <b id="rjlt" style="font-size: 25px;margin-top: 5px;">00:00</b>
                <p id="rjlj">未选择</p>
            </div>
        </div>

        <div style="text-align: center;margin-bottom: 10px;">
            <br>
            <p style="margin-left: 10px;color: #000;font-size: 15px;" id="rrTime">未选择</p>
        </div>

        <div style="text-align: center;margin-bottom: 10px;">
            <br>
            <p style="margin-left: 10px;color: #000;font-size: 15px;" id="rrcang">未选择</p>
        </div>

    </div>

    <div>

        <div id="card2" class="card1"
             style="height: auto;color: #000;width: 800px;margin-top: 0px;margin-left: 20px;margin-right: 0px;">


            <div style="margin: 20px;text-align:center;">


                <h3 class="pg-title">添加乘机人</h3>
                <br>
                <form class="form-inline" style="text-align: center;">

                    <div class="row">

                        <div class="form-group col-md-1"></div>
                        <div class="form-group col-md-5">
                            <label for="name">姓名</label>
                            <input type="text" class="form-control" id="name" placeholder="请输入姓名">
                        </div>
                        <div id="cccc" class="form-group col-md-5">
                            <label for="cardId">身份证号</label>
                            <input type="text" class="form-control" id="cardId" placeholder="请输入身份证号">
                        </div>
                        <div class="form-group col-md-1"></div>
                    </div>
                    <br>
                    <div class="row">
                        <div class="form-group col-md-1"></div>
                        <div class="form-group col-md-5">
                            <label for="birth">生日</label>
                            <input type="text" class="form-control" id="birth" placeholder="请输入生日" disabled>
                        </div>
                        <div class="form-group col-md-5">
                            <label for="phone">电话号码</label>
                            <input type="text" class="form-control" id="phone" placeholder="请输入电话">
                        </div>
                        <div class="form-group col-md-1"></div>
                    </div>
                    <br>
                    <button type="button" id="addP" class="button" style="vertical-align:middle;margin-bottom: 0px;"><span>添加</span>
                    </button>

                </form>

            </div>

        </div>

        <div id="card4" class="card1"
             style="height: auto;color: #000;width: 800px;margin-top: 0px;margin-left: 20px;margin-right: 0px;">

            <div id="father" style="margin: 20px;text-align:center;">


                <h3 class="pg-title">乘机人信息</h3>

                <div class="row" style="margin-top: 15px;">

                    <div class="form-group col-md-2">
                        <p>姓名</p>
                    </div>
                    <div class="form-group col-md-3">
                        <p>身份证</p>

                    </div>
                    <div class="form-group col-md-2">
                        <p>生日</p>

                    </div>
                    <div class="form-group col-md-2">
                        <p>电话号</p>

                    </div>
                    <div class="form-group col-md-2">
                        <p>碳基生物</p>

                    </div>
                    <div class="form-group col-md-1">
                        <p>操作</p>

                    </div>


                </div>
            </div>

        </div>

    </div>

    <div id="card3" class="card1" style="height: auto;width: 300px;margin-left: 20px;color: #000;">


        <h3 style="color: #000">订单费用明细</h3>

        <div> <span>成人</span> ¥<span id="fy1">840</span> X<span id="ps1">0</span> </div>


        <div><span>机场税</span> ¥<span>50</span> X<span id="ps2">0</span></div>
        <div><span>燃油费</span> ¥<span>40</span> X<span id="ps3">0</span></div>

        <br>
        <div> 儿童 ¥<span id="fy2">420</span> X<span id="ps4">0</span></div>

        <div>机场税 免费</div>

        <div>燃油费 免费</div>

        <br>
        <div style="font-size: 18px;">
            <div class="bottom">含税总价 : <span class="price red">¥<span id="zfy">0</span></span></br>
            </div>


        </div>
        <br>

        <button id="sub" class="button" style="vertical-align:middle;margin-bottom: 20px;"><span>提交订单</span></button>

    </div>
</div>

<script>
    var personinfo= [];
    var size=0;
    var dddd ;
    var cang;

    $(function () {

        $.ajax({
            url: "/getName",
            type: "get",
            dataType: "json",
            success: function (data) {
                if (data.success){
                    loginFlag=1;
                    $("#namee").text(data.data);
                }else{
                    $("#namee").text("未登录");
                    location.href="login.html";
                }
            }
        })



        var pathName=window.document.location.pathname;
        var curWwwPath=window.document.location.href;
        var pos=curWwwPath.indexOf(pathName);
        var prefixUrl=curWwwPath.substring(0,pos);
        console.log("prefixUrl:"+prefixUrl);

        var flightId = getQueryVariable("flightId");
        var aldult = getQueryVariable("aldult");
        var child = getQueryVariable("child");
        cang = getQueryVariable("cang");


        $("#sub").click(function () {

            $.ajax({
                url: prefixUrl+"/pg",
                type: "post",
                data: {
                    "cang":cang,
                    "pgs": JSON.stringify(personinfo),
                    "flightId":flightId
                },
                dataType: "json",
                success: function (data) {
                    console.log("登录返回信息为：");
                    console.log(data);
                    if (data.success){
                        console.log("跳转");
                        location.href = "cashier.html?orderId="+data.data.id;
                    }
                }
            });

        })

        $("#rrcang").text(cang ===1?"头等舱":"经济舱");

        $("#addP").click(function () {



            console.log("添加用户");
            var name = $("#name").val();
            var phone = $("#phone").val();
            var cardId = $("#cardId").val();
            var birth = $("#birth").val();

            for (var i = 0 ; i < personinfo.length;i++){

                if (cardId === personinfo[i].cardId){
                    console.log("重复");
                    alert("重复啦啦啦啦！！！！！");
                    return ;
                }
            }

            var num = personinfo.length;

            var myDate = new Date();
            var month = myDate.getMonth() + 1;
            var day = myDate.getDate();
            var age = myDate.getFullYear() - cardId.substring(6, 10) - 1;
            if (cardId.substring(10, 12) < month || cardId.substring(10, 12) === month && cardId.substring(12, 14) <= day) {
                age++;
            }

            var ob ="{\n" +
                "    \"name\":\""+ name +"\",\n" +
                "    \"phone\":\""+ phone +"\",\n" +
                "    \"cardId\":\""+ cardId +"\",\n" +
                "    \"birth\":\""+ birth +"\",\n" +
                "    \"age\":\""+ age +"\"\n" +
                "}";
            personinfo.push(JSON.parse(ob));
            console.log(personinfo);




            var bb = $('<div></div>').attr("style","margin-top: 0px;").addClass("row").attr("id","info"+num);


            var cc = $('<div></div>').addClass("form-group col-md-2").append($('<p></p>').text(name));
            var gg = $('<div></div>').addClass("form-group col-md-3").append($('<p></p>').text(cardId));
            var dd = $('<div></div>').addClass("form-group col-md-2").append($('<p></p>').text(birth));
            var ee = $('<div></div>').addClass("form-group col-md-2").append($('<p></p>').text(phone));
            var ff = $('<div></div>').addClass("form-group col-md-2").append($('<p></p>').text(age>12?'成人':'儿童'));
            var xx = $('<div></div>').addClass("form-group col-md-1").append($('<p></p>').text("X")).attr("onclick","del("+num+")");

            bb.append(cc).append(gg).append(dd).append(ee).append(ff).append(xx);

            $("#father").append(bb);
            shuaxin();
        })




        $.ajax({
            url: prefixUrl+"/flightById",
            type: "get",
            data: {
                "id": flightId
            },
            dataType: "json",
            success: function (data) {
                console.log("登录返回信息为：");
                console.log(data);
                dddd = data;

                $("#rrTime").text(data.name + " (" + data.aircrafts.model + ")");
                $("#rjlj").text(data.landingairport.airportName);
                $("#rjlt").text(data.landingTime.substring(14));
                $("#rqfj").text(data.takeOffairport.airportName);
                $("#rqft").text(data.takeOffTime.substring(14));

                var jjc = data.economyClass;
                var tdc = data.firstClass;
                $("#fy1").text(cang===1?tdc:jjc);
                $("#fy2").text(cang===1?tdc/2:jjc/2);
            }
        });


        $('#cardId').keyup(function () {
            console.log("身份证");
            var code = $(this).val();
            if (code.length === 18) {
                //if (check_id_card(code)) {
                if (true) {
                    $('#cccc').removeClass("has-error");
                    console.log("合法");
                    var ele = $("#cardId").val();
                    var birth = ele.substring(6, 10) + "-" + ele.substring(10, 12) + "-" + ele.substring(12, 14);
                    console.log(birth);
                    $("#birth").val(birth);
                } else {
                    console.log("不合法");
                    $('#cccc').addClass("has-error");
                }

            } else {
                $('#cccc').addClass("has-error");
            }

        });

        function check_id_card(code) {
            code = code.toUpperCase();

            // 前2位城市码
            let city = {
                11: "北京",
                12: "天津",
                13: "河北",
                14: "山西",
                15: "内蒙古",
                21: "辽宁",
                22: "吉林",
                23: "黑龙江",
                31: "上海",
                32: "江苏",
                33: "浙江",
                34: "安徽",
                35: "福建",
                36: "江西",
                37: "山东",
                41: "河南",
                42: "湖北",
                43: "湖南",
                44: "广东",
                45: "广西",
                46: "海南",
                50: "重庆",
                51: "四川",
                52: "贵州",
                53: "云南",
                54: "西藏",
                61: "陕西",
                62: "甘肃",
                63: "青海",
                64: "宁夏",
                65: "新疆",
                71: "台湾",
                81: "香港",
                82: "澳门",
                91: "国外 "
            };
            // 加权因子
            let factor = [7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2];
            // 校验位
            let parity = [1, 0, 'X', 9, 8, 7, 6, 5, 4, 3, 2];
            // 身份证简单正则
            let Reg = /^\d{6}(18|19|20)?\d{2}((0[1-9])|(1[0-2]))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/;
            // 身份证号码数组
            let arr_code = code.split('');

            // 校验编码为空，简单正则，城市编码
            if (!code || !Reg.test(code) || !city[code.substr(0, 2)] || code.length !== 18) {
                return false;
            }

            // 校验18位身份证需要验证最后一位校验位
            //∑(ai×Wi)(mod 11)
            let sum = 0;
            for (let i = 0; i < 17; i++) {
                sum += arr_code[i] * factor[i];
            }
            if (parity[sum % 11] != arr_code[17]) {
                return false;
            }

            return true;
        }
    })

    function shuaxin() {
        var cr = 0;
        var et = 0;
        for(var i = 0 ; i < personinfo.length;i++){
            if(personinfo[i].age <= 12){
                et = et +1;
            }else{
                cr = cr +1;
            }
        }

        $("#ps1").text(cr);
        $("#ps2").text(cr);
        $("#ps3").text(cr);
        $("#ps4").text(et);

        var jjc = dddd.economyClass;
        var tdc = dddd.firstClass;
        var zz = cang===1?tdc:jjc;
        console.log(zz);
        var zj = zz*cr + zz/2*et;
        $("#zfy").text(zj);
    }

    function del(num){
        personinfo.splice(num,1);
        console.log(personinfo);

        var hb= "#info"+num;
        console.log(hb);
        $(hb).remove();
        shuaxin();

    }

    function removeByValue(arr, val) {
        for(var i=0; i<arr.length; i++) {
            if(arr[i] == val) {
                arr.splice(i, 1);
                break;
            }
        }
    }


    function getQueryVariable(variable) {
        var query = window.location.search.substring(1);
        var vars = query.split("&");
        for (var i = 0; i < vars.length; i++) {
            var pair = vars[i].split("=");
            if (pair[0] == variable) {
                return pair[1];
            }
        }
        return (false);
    }

</script>

</body>

</html>